package cn.xyafu.service.impl;

import cn.xyafu.dao.UserDao;
import cn.xyafu.po.User;
import cn.xyafu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    //通过id查找用户
    @Override
    public User findUserByUid(Integer uid) {
        return this.userDao.findUserByUid(uid);
    }
    //通过昵称查找用户
    @Override
    public User findUserByUnikename(String unikeName) {
        return this.userDao.findUserByUnikename(unikeName);
    }
    //登录验证
    @Override
    public User findUserByUser(User user) {
        return this.userDao.findUserByUser(user);
    }
    //添加用户
    @Override
    public Integer addUser(User user) {
        return this.userDao.addUser(user);
    }
    //更新信息
    @Override
    public Integer updateUser(User user) {
        return this.userDao.updateUser(user);
    }
}
